import {
	RECORD_ADDRESS,
	DAY_NIGHT_CHANGE,
	SHOW_LEFT_MENU,

} from './mutation-types.js'

import {setStore, getStore} from '../utils/mUtils'


export default {
	hasRoute(state, val) {
		state.hasRoute = val;
	},
	setSyncTime(state, val){
		this.dispatch('getSyncTime');   // mutations 调用 actions
		this.commit('hasRoute',''); // mutations 调用 mutations
	},

	 // 白天黑夜切换// type 1晚上 2白天切换
	[DAY_NIGHT_CHANGE](state, type) {
		console.log(type);
		state.isDay = type==2?true:false;
		localStorage.setItem('isDay',type + '');
	},

	// 显示菜单栏
	[SHOW_LEFT_MENU](state) {
		state.showLeft = !state.showLeft;
	},
	// 记录当前经度纬度
	[RECORD_ADDRESS](state, {
		latitude,
		longitude
	}) {
		state.latitude = latitude;
		state.longitude = longitude;
	},



}
